# -*- coding: utf-8 -*-
'''
Created on 2012-9-4

@author: Leon
'''
# all the imports
import os
from flask import Flask, request, current_app, render_template, \
    g, abort, redirect, url_for, jsonify
from datetime import datetime

# configuration----------------------------------------------------
DATABASE = ''
DEBUG = False
SECRET_KEY = ''
USERNAME = ''
PASSWORD = ''

HERE = os.path.dirname(os.path.abspath(__file__))
#DATA_FOLDER = os.path.join(HERE, 'data')
#DATA_PATH = os.path.join(DATA_FOLDER, 'grape.db')


# create our little application :)------------------------------------
application = app = Flask(__name__)
app.config.from_object(__name__)


#---------------------------------------------------------------------
@app.before_first_request
def before_first_request():
    pass

#
@app.before_request
def before_request():
    pass


#
@app.teardown_request
def teardown_request(exception):
    pass


#
@app.errorhandler(404)
def page_not_found(error):
    return render_template('404.html'), 404


# register view actions------------------------------------------------------
#view actions
@app.route('/')
def index():
    return render_template('index.html',
                           title=u'首页 | 景致创意工作室', page='index')


@app.route('/cases')
def cases():
    return render_template('cases.html',
                           title=u'案例 | 景致创意工作室', page='cases')


@app.route('/service')
def service():
    return render_template('service.html',
                           title=u'服务 | 景致创意工作室', page='service')


@app.route('/member')
def member():
    return render_template('member.html',
                           title=u'成员 | 景致创意工作室', page='member')


#关于
@app.route('/about')
def about():
    return render_template('about.html',
                           title=u'关于 | 景致创意工作室', page='about')

#友链
@app.route('/links')
def links():
    return render_template('links.html',
                           title=u'友链 | 景致创意工作室', page='links')


# main
if __name__ == '__main__':
    app.run()












